package nconv.convert.plugins;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by xiaobyu on 5/16/2016.
 */
public class P29329 extends DefaultTGPPConvertPlugin{
    Set<String> avpDefHeading = new HashSet<>(Arrays.asList("UDR-Flags"));

    Set<String> escapedAVPs = new HashSet<>(Arrays.asList(
            "User-Data", "Server-Name", "Supported-Features", "Feature-List-ID", "Feature-List",
            "Supported-Applications", "Public-Identity", "Wildcarded-Public-Identity", "Wildcarded-IMPU", "Session-Priority",
            "Call-Reference-Number", "AS-Number", "OC-Supported-Features", "OC-OLR", "DRMP"));

    @Override
    public String getReplacedAVPDefOrDiameterMessageHeading(String original) {
        if (avpDefHeading.contains(original.trim())) {
            return original + " AVP";
        }

        if (original.equals("Command-Code values")) {
            return "Sh messages";
        }
        return original;
    }

    @Override
    public boolean isDiameterAVPTable(String tableName) {
        return tableName.endsWith("Diameter Multimedia Application AVPs");
    }

    @Override
    public boolean isAVPDefineEscaped(String avpName) {
        return escapedAVPs.contains(avpName);
    }

    @Override
    public boolean enableDetectionOnChildAVPs() {
        return true;
    }
}
